﻿// See https://aka.ms/new-console-template for more information
using DbFactory;
using SharpConsoleApp;

Console.WriteLine("=== 开始运行示例程序 ===");

// 创建数据库连接
IDatabaseConnection connection = ConnectionFactory.createConnetction("mysql");
connection.connect();



connection.disconnect();

//try
//{
//    // 创建表
//    connection.CreateTable<PersonOne>();
//    connection.CreateTable<Order>();

//    // 插入一些测试数据
//    var testPerson = new PersonOne
//    {
//        Id = 1,
//        personName = "John Doe",
//        personDetail = "Test person",
//        Age = 25,
//        Status = "Active",
//        CreateTime = DateTime.Now
//    };
//    connection.insert(testPerson);

//    var testOrder = new Order
//    {
//        Id = 1,
//        PersonId = 1,
//        OrderDate = DateTime.Now,
//        Amount = 100.50m,
//        Status = "Completed"
//    };
//    connection.insert(testOrder);

//    // 运行查询示例
//    var examples = new QueryExamples(connection);
//    examples.RunAllExamples();
//}
//catch (Exception ex)
//{
//    Console.WriteLine($"发生错误: {ex.Message}");
//}
//finally
//{
//    // 关闭连接
//    connection.disconnect();
//}

//Console.WriteLine("=== 示例程序运行完成 ===");

//ushort s = 1;

//Console.WriteLine(s);



